#include<bits/stdc++.h>
using namespace std;
namespace IO
{
	char buff[1<<21],*p1=buff,*p2=buff;
	char getch(){return p1==p2&&(p2=((p1=buff)+fread(buff,1,1<<21,stdin)),p1==p2)?EOF:*p1++;}
	template<typename T>void read(T &x){char CH=getch();int fl=1;x=0;while(CH>'9'||CH<'0'){if(CH=='-')fl=-1;CH=getch();}while(CH<='9'&&CH>='0'){x=x*10+CH-48;CH=getch();}x*=fl;}
	template<typename T>void read_s(T &x){x="";char CH=getch();while(!(CH>='a'&&CH<='z')&&!(CH>='A'&&CH<='Z'))CH=getch();while((CH>='a'&&CH<='z')||(CH>='A'&&CH<='Z')){x+=CH;CH=getch();}}
	template<typename T,typename ...Args>void read(T &x,Args& ...args){read(x);read(args...);}
	char obuf[1<<21],*p3=obuf;
	void putch(char CH) {if(p3-obuf<(1<<21))*p3++=CH;else fwrite(obuf,p3-obuf,1,stdout),p3=obuf,*p3++=CH;}
	char CH[100];
	template<typename T>void write(T x) {if(!x)return putch('0');if(x<0)putch('-'),x*=-1;int top=0;while(x)CH[++top]=x%10+48,x/=10;while(top)putch(CH[top]),top--;}
	template<typename T,typename ...Args>void write(T x,Args ...args) {write(x);putch(' ');write(args...);}
	void put(string s){for(int i=0;i<s.size();i++)putch(s[i]);}
	void flush(){fwrite(obuf,p3-obuf,1,stdout);}
}
using namespace IO;
struct node
{
	int nxt,to;
}e[100005<<1];
int head[100005],cnt_edge;
void add_edge(int u,int v)
{
	e[++cnt_edge].to=v;
	e[cnt_edge].nxt=head[u];
	head[u]=cnt_edge;
}
int n,m,k;
int w[100005];
vector<int>ans[100005];
int cnt;
int vis[100005];
vector<int> dfs(int u)
{
	vis[u]=1;
	vector<int>now;
	for(int i=head[u];i;i=e[i].nxt)
	{
		int v=e[i].to;
		if(vis[v]) continue;
		vector<int>pre=dfs(v);
		if(now.size()&&pre.size())
		{
			++cnt;
			for(int x:now) ans[cnt].push_back(x);ans[cnt].push_back(u);
			for(int j=pre.size()-1;~j;j--) ans[cnt].push_back(pre[j]); 
			now.clear();
		}
		else if(pre.size()) swap(now,pre);
	}
	if(now.size())
	{
		if(w[u]) ++cnt,ans[cnt]=now,ans[cnt].push_back(u),now.clear();
		else now.push_back(u);
	}
	else if(w[u]) now.push_back(u);
	return now;
}
int main()
{
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	read(n,m,k);
	for(int i=1;i<=m;i++)
	{
		int u,v;read(u,v);
		add_edge(u,v);add_edge(v,u);
	}
	for(int i=1;i<=k;i++)
	{
		int x;read(x);
		w[x]=1;
	}
	for(int i=1;i<=n;i++) if(!vis[i]) dfs(i);
	write(cnt),putch('\n');
	for(int i=1;i<=cnt;i++)
	{
		write(ans[i].size()),putch(' ');
		for(int x:ans[i]) write(x),putch(' ');
		putch('\n');
	}
	flush();
	return 0;
}
/*
5 4 4
1 2
2 3
4 2
5 2
1 3 4 5
*/
